/*
 * @: 
 * @Version: 1.0
 * @Autor: ziwei
 * @Date: 2021-06-21 15:01:07
 * @LastEditors: ziwei
 * @LastEditTime: 2021-12-22 16:47:45
 */
let obj = {};
let ageValue = 10;

Object.defineProperty(obj,'age',{
    get(){
      return ageValue;
    },
    set(newValue){
      ageValue = newValue
    },
    enumerable:true,
    configurable:true
})

console.log(obj.age)
obj.age = 20
console.log(obj.age)